﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/FrontSite.Master" Inherits="System.Web.Mvc.ViewPage" Title="前台首页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    采油井单井月曲线
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

    <link href="../../Scripts/Ext4_2/resources/css/ext-all.css" rel="stylesheet" />
    <script src="../../Scripts/Ext4_2/resources/ext-all.js"></script>
    <script src="../../Curves/CYJMonthCurve.js"></script>
    <script src="../../Curves/Line.js"></script>
    <script src="../../Content/My97DatePicker/WdatePicker.js"></script>
    <link href="../../Content/sideBar.css" rel="stylesheet" />
    <script>
        //设置当前导航栏的样式为“已点击”
        jQuery(document).ready(function ($) {
            $('#lnkbtnSingleWellMonthCurve').css("color", "red");
        })

        //刷新“btnLogin”为“btnLogout”
        $(document).ready(function () {
            document.getElementById("btnLogin").text = "退出";
        });

        $(document).ready(function () {
            //点击“查询”按钮后进行刷新
            $("#queryBtn").click(function () {
                //得到参数
                //var WorkZoneSelect = $('#WorkZoneSelect option:selected').val();
                //var SCDDSelect = $('#SCDDSelect option:selected').val();
                //var JXSelect = $('#JXSelect option:selected').val();
                var JHSelect = $('#JHSelect option:selected').val();
                var productdate_box = $("#MainContentPlaceHolder_productdate_box").val();
                //更新store1
                store1.load({
                    params: { JHSelect: JHSelect, productdate_box: productdate_box },
                    url: 'CYJMonthCurveQuery',
                    method: 'POST',
                    success: function (sesponseTest) {
                        alert(sesponseTest);
                    },
                    failure: function (data) {
                    }
                });
            });
        });

        //点击“查询”按钮后进行刷新
        //function queryBtn_Click() {
        //    location = 'CYJMonthCurve';
        //}

        //设置select菜单的ajax联动效果
        //根据WorkZoneSelect菜单的选值获取当前作业区下的生产大队列表
        $(function () {
            //先去获取“第一作业区”下的所有“采油大队”
            $.ajax({
                url: "SCDDSelect?workZoneSelectValue=第一作业区",
                type: 'get',
                dataType: 'JSON',
                timeout: 5000,
                success: function (data) {
                    $("#SCDDSelect").empty();
                    $.each(eval(data), function (i, item) {
                        $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#SCDDSelect"));
                    });
                }
            });

            $("#WorkZoneSelect").change(function () {
                //先获取WorkZoneSelect菜单的当前选值
                var workZoneSelectValue = $('#WorkZoneSelect option:selected').val();
                //再把这个值传到后台去
                $.ajax({
                    url: "SCDDSelect?workZoneSelectValue=" + workZoneSelectValue,
                    type: 'get',
                    dataType: 'JSON',
                    timeout: 5000,
                    //error: function() {alert('加载数据异常，请重试!');},
                    success: function (data) {
                        $("#SCDDSelect").empty();
                        $.each(eval(data), function (i, item) {
                            $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#SCDDSelect"));
                        });
                    }
                });
            });
            //当采油井类型改变时改变“井号”的列表项
            $("#JXSelect").change(function () {
                var SCDDSelectValue = $('#SCDDSelect option:selected').val();
                //先获取JXSelect菜单的当前选值
                var JXSelectValue = $('#JXSelect option:selected').val();
                //再把这个值传到后台去
                $.ajax({
                    url: "JHSelect?strSCDD=" + SCDDSelectValue + "&strJX=" + JXSelectValue,
                    type: 'get',
                    dataType: 'JSON',
                    timeout: 5000,
                    //error: function() {alert('加载数据异常，请重试!');},
                    success: function (data) {
                        $("#JHSelect").empty();
                        $.each(eval(data), function (i, item) {
                            $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#JHSelect"));
                        });
                    }
                });
            });
            //页面加载时，默认加载“第一采油大队”、“抽油机井”
            $.ajax({
                url: "JHSelect?strSCDD=第一采油大队&strJX=抽油机井",
                type: 'get',
                dataType: 'JSON',
                timeout: 5000,
                success: function (data) {
                    $("#JHSelect").empty();
                    $.each(eval(data), function (i, item) {
                        $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#JHSelect"));
                    });
                }
            });
        });
    </script>

    <style type="text/css">
        #menu1 {
            width: 200px;
            float: left;
        }

            #menu1 ul {
                font-family: Arial, Helvetica, sans-serif;
                list-style-type: none;
                margin: 0;
                padding: 0;
            }

            #menu1 li {
                display: inline;
                /* for IE5 and IE6 */
            }

            #menu1 a {
                color: #000;
                text-decoration: none;
                font-size: 14px;
                display: block;
                padding: 3px;
                width: 120px;
                background-color: #FDFCF3;
                border: 1px dotted #B5E3C7;
                margin: 0px 0px 4px 0px;
            }

                #menu1 a:link, #menu a:visited {
                    color: #000;
                    text-decoration: none;
                }

                #menu1 a:hover {
                    background-color: #B5E3C7;
                    color: #FDFCF3;
                }

            #menu1 li a#current {
                border-bottom: 3px solid #B5E3C7;
                background: #B5E3C7;
                color: #FDFCF3;
            }
        /* Menu 1 ends here */
    </style>


    <h1 style="text-align: center">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;采油井单井月曲线</h1>
    <br />
    <p class="auto-style5">
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;工作区：<select id="WorkZoneSelect">
            <option>第一作业区</option>
            <option>第二作业区</option>
            <option>第三作业区</option>
        </select>
        &nbsp;&nbsp;&nbsp; 采油大队：<select id="SCDDSelect">
        </select>
        &nbsp;&nbsp;&nbsp; 采油井类型：<select id="JXSelect">
            <option>抽油机井</option>
            <option>电潜泵井</option>
            <option>螺杆泵井</option>
            <option>水力喷射井</option>
            <option>自喷井</option>
        </select>&nbsp;&nbsp;&nbsp; 井号：<select id="JHSelect">
            <option>CYJJ_1_1_1_1</option>
            <option>CYJJ_1_1_1_2</option>
            <option>CYJJ_1_1_1_3</option>
            <option>CYJJ_1_1_1_4</option>
            <option>CYJJ_1_1_1_5</option>
        </select>
        &nbsp;&nbsp;&nbsp;&nbsp; 生产年月：
        <input id="productdate_box" runat="server" class="Wdate" value="2014-09" onclick="WdatePicker({ dateFmt: 'yyyy-MM' })" type="text" style="width: 100px" />&nbsp;&nbsp;&nbsp;
        <input type="button" id="queryBtn" value="查询" />
    </p>


    <div id="curveDiv" style="text-align: center">
    </div>
    <br />

    <ul id="dock">
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <li id="links" onclick="location='CYJMonthCurve'"></li>
        <li id="files" onclick="location='ZSJMonthCurve'"></li>
        <li id="tools" onclick="location='CQJMonthCurve'"></li>
    </ul>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
    </a>
    </div>
</asp:Content>
